<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>游戏设置 - 龙虎斗</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            background-attachment: fixed;
            min-height: 100vh;
            color: #333;
            transition: background 0.3s ease;
        }

        .container {
            max-width: 480px;
            margin: 0 auto;
            background: transparent;
            min-height: 100vh;
            position: relative;
        }

        .header {
            background: rgba(102, 126, 234, 0.9);
            backdrop-filter: blur(10px);
            color: white;
            padding: 20px;
            text-align: center;
            position: relative;
            border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        }

        .back-btn {
            position: absolute;
            left: 20px;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            font-size: 18px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(10px);
        }

        .header h1 {
            font-size: 20px;
            font-weight: 600;
            margin: 0;
        }

        .settings-content {
            padding: 20px;
        }

        .settings-section {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(15px);
            border-radius: 20px;
            padding: 30px;
            margin-bottom: 25px;
            border: 1px solid rgba(255, 255, 255, 0.2);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
            position: relative;
            overflow: hidden;
        }

        .settings-section::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, #4facfe, #00f2fe, #ff6b6b);
            opacity: 0.8;
        }

        .settings-title {
            color: white;
            font-size: 22px;
            margin-bottom: 30px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 15px;
            letter-spacing: 0.5px;
            padding-bottom: 15px;
            border-bottom: 2px solid rgba(255, 255, 255, 0.3);
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        }

        .setting-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 25px 20px;
            margin-bottom: 15px;
            border-radius: 16px;
            gap: 25px;
            transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
            border: 1px solid rgba(255, 255, 255, 0.2);
            position: relative;
            overflow: hidden;
        }

        .setting-item::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
            transition: left 0.5s ease;
        }

        .setting-item:hover::before {
            left: 100%;
        }

        .setting-item:hover {
            transform: translateY(-3px);
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
            box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
            border-color: rgba(255, 255, 255, 0.4);
        }

        .setting-item:last-child {
            margin-bottom: 0;
        }

        .setting-left {
            display: flex;
            align-items: center;
            gap: 20px;
            flex: 1;
            min-width: 0;
        }

        .setting-icon {
            font-size: 20px;
            width: 50px;
            height: 50px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            color: white;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
            transition: all 0.3s ease;
        }

        .setting-item:hover .setting-icon {
            transform: scale(1.1);
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
        }

        .setting-content {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
            gap: 8px;
        }

        .setting-label {
            color: white;
            font-size: 18px;
            font-weight: 600;
            letter-spacing: 0.3px;
            line-height: 1.2;
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        }

        .setting-desc {
            color: rgba(255, 255, 255, 0.85);
            font-size: 14px;
            line-height: 1.4;
            opacity: 0.9;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
        }

        .toggle-switch {
            position: relative;
            width: 60px;
            height: 30px;
            background: rgba(255, 255, 255, 0.3);
            border-radius: 15px;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            border: 1px solid rgba(255, 255, 255, 0.2);
            backdrop-filter: blur(10px);
            flex-shrink: 0;
            margin-left: 20px;
        }

        .toggle-switch:hover {
            background: rgba(255, 255, 255, 0.4);
            transform: scale(1.05);
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-label {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(255, 255, 255, 0.2);
            transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            border-radius: 15px;
            border: 1px solid rgba(255, 255, 255, 0.3);
        }

        .toggle-label:before {
            position: absolute;
            content: "";
            height: 22px;
            width: 22px;
            left: 3px;
            bottom: 3px;
            background: linear-gradient(135deg, #ffffff, #f8f9fa);
            transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            border-radius: 50%;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }

        input:checked + .toggle-label {
            background: linear-gradient(135deg, #667eea, #764ba2);
            box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
        }

        input:checked + .toggle-label:before {
            transform: translateX(27px);
        }

        .volume-slider {
            width: 130px;
            flex-shrink: 0;
            margin-left: 20px;
        }

        .slider {
            width: 100%;
            height: 10px;
            border-radius: 5px;
            background: rgba(255, 255, 255, 0.3);
            outline: none;
            -webkit-appearance: none;
            cursor: pointer;
            border: 1px solid rgba(255, 255, 255, 0.2);
            backdrop-filter: blur(10px);
            transition: all 0.3s ease;
        }

        .slider:hover {
            background: rgba(255, 255, 255, 0.4);
            border-color: rgba(255, 255, 255, 0.4);
        }

        .slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            cursor: pointer;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
            border: 2px solid rgba(255, 255, 255, 0.8);
            transition: all 0.3s ease;
        }

        .slider::-webkit-slider-thumb:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
        }

        .slider::-moz-range-thumb {
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            cursor: pointer;
            border: 2px solid rgba(255, 255, 255, 0.8);
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
        }



        .color-picker-trigger {
            display: flex;
            align-items: center;
            gap: 12px;
            cursor: pointer;
            padding: 12px 18px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-radius: 15px;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
            backdrop-filter: blur(10px);
            min-width: 130px;
            flex-shrink: 0;
            transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            margin-left: 20px;
        }

        .color-picker-trigger:hover {
            border-color: rgba(255, 255, 255, 0.6);
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.1));
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
        }

        .current-color {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: 3px solid rgba(255, 255, 255, 0.6);
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
            transition: all 0.3s ease;
        }

        .color-picker-trigger:hover .current-color {
            transform: scale(1.1);
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
        }

        .color-arrow {
            color: rgba(255, 255, 255, 0.8);
            font-size: 14px;
            font-weight: 600;
            transition: all 0.3s ease;
        }

        .color-picker-trigger:hover .color-arrow {
            color: rgba(255, 255, 255, 1);
            transform: scale(1.1);
        }

        .setting-arrow {
            color: rgba(255, 255, 255, 0.8);
            font-size: 20px;
            font-weight: 600;
            margin-left: 15px;
            transition: all 0.3s ease;
        }

        .setting-item:hover .setting-arrow {
            color: rgba(255, 255, 255, 1);
            transform: translateX(3px);
        }

        /* 帮助中心弹窗 */
        .help-modal {
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(10px);
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        .help-modal.show {
            opacity: 1;
            visibility: visible;
        }

        .help-modal-content {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
            backdrop-filter: blur(20px);
            border-radius: 25px;
            padding: 0;
            max-width: 500px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(255, 255, 255, 0.3);
            transform: scale(0.8) translateY(20px);
            transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        .help-modal.show .help-modal-content {
            transform: scale(1) translateY(0);
        }

        .help-modal-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 25px 30px;
            border-radius: 25px 25px 0 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: relative;
            overflow: hidden;
        }

        .help-modal-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
            animation: shimmer 2s infinite;
        }

        @keyframes shimmer {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(100%); }
        }

        .help-modal-header h3 {
            margin: 0;
            font-size: 22px;
            font-weight: 700;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
            z-index: 1;
            position: relative;
        }

        .help-close-btn {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            font-size: 24px;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            cursor: pointer;
            transition: all 0.3s ease;
            backdrop-filter: blur(10px);
            z-index: 1;
            position: relative;
        }

        .help-close-btn:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: scale(1.1);
        }

        .help-modal-body {
            padding: 30px;
        }

        .help-section {
            margin-bottom: 30px;
        }

        .help-section:last-child {
            margin-bottom: 0;
        }

        .help-section h4 {
            color: #495057;
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 2px solid #e9ecef;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .help-section ul {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .help-section li {
            color: #6c757d;
            font-size: 15px;
            padding: 8px 0;
            border-left: 3px solid #e9ecef;
            padding-left: 15px;
            margin-bottom: 5px;
            transition: all 0.3s ease;
        }

        .help-section li:hover {
            border-left-color: #667eea;
            color: #495057;
            transform: translateX(5px);
        }

        .contact-info {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .contact-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 15px;
            background: rgba(102, 126, 234, 0.05);
            border-radius: 12px;
            border: 1px solid rgba(102, 126, 234, 0.1);
            transition: all 0.3s ease;
        }

        .contact-item:hover {
            background: rgba(102, 126, 234, 0.1);
            border-color: rgba(102, 126, 234, 0.2);
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
        }

        .contact-icon {
            font-size: 20px;
            width: 40px;
            height: 40px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            flex-shrink: 0;
        }

        .contact-label {
            color: #495057;
            font-weight: 600;
            font-size: 14px;
            min-width: 80px;
        }

        .contact-value {
            color: #667eea;
            font-weight: 500;
            font-size: 14px;
            word-break: break-all;
        }

        .help-section p {
            color: #6c757d;
            font-size: 14px;
            line-height: 1.6;
            margin: 8px 0;
            padding-left: 25px;
        }

        .help-modal-footer {
            padding: 20px 30px 30px;
            text-align: center;
            border-top: 1px solid #e9ecef;
        }

        .help-btn-primary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            padding: 15px 40px;
            border-radius: 25px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        }

        .help-btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
        }

        /* 测试震动按钮样式 */
        .test-vibration-btn {
            background: linear-gradient(135deg, #ff6b6b, #ee5a24);
            border: none;
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            font-size: 18px;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .test-vibration-btn:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
        }

        .test-vibration-btn:active {
            transform: scale(0.95);
        }

        /* 音效状态指示器样式 */
        .sound-status {
            font-size: 20px;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.3);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            flex-shrink: 0;
        }

        .sound-status.muted {
            background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(238, 90, 36, 0.1));
            border-color: rgba(255, 107, 107, 0.4);
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .help-modal-content {
                width: 95%;
                max-width: none;
                margin: 20px;
                max-height: 85vh;
            }

            .help-modal-header {
                padding: 20px 25px;
            }

            .help-modal-header h3 {
                font-size: 20px;
            }

            .help-modal-body {
                padding: 25px;
            }

            .help-section h4 {
                font-size: 16px;
            }

            .contact-item {
                flex-direction: column;
                align-items: flex-start;
                gap: 8px;
                padding: 12px;
            }

            .contact-label {
                min-width: auto;
                font-size: 13px;
            }

            .contact-value {
                font-size: 13px;
                padding-left: 0;
            }

            .help-modal-footer {
                padding: 15px 25px 25px;
            }

            .help-btn-primary {
                padding: 12px 30px;
                font-size: 15px;
            }
        }

        /* 颜色选择模态框 */
        .color-modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
        }

        .color-modal-content {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: white;
            border-radius: 20px 20px 0 0;
            padding: 20px;
            max-height: 80vh;
            overflow-y: auto;
            animation: slideUp 0.3s ease-out;
        }

        @keyframes slideUp {
            from {
                transform: translateY(100%);
            }
            to {
                transform: translateY(0);
            }
        }

        .color-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 1px solid #e9ecef;
        }

        .color-modal-title {
            font-size: 18px;
            font-weight: 600;
            color: #495057;
        }

        .close-btn {
            background: none;
            border: none;
            font-size: 24px;
            color: #6c757d;
            cursor: pointer;
            padding: 5px;
        }

        .color-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 15px;
            margin-bottom: 20px;
        }

        .color-option-modal {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            padding: 10px;
            border-radius: 12px;
            transition: all 0.2s;
        }

        .color-option-modal:hover {
            background: #f8f9fa;
            transform: scale(1.05);
        }

        .color-option-modal.selected {
            background: #e3f2fd;
            border: 2px solid #2196f3;
        }

        .color-preview {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            border: 3px solid white;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .color-name {
            font-size: 12px;
            color: #495057;
            text-align: center;
            font-weight: 500;
        }

        /* 响应式设计 */
        @media (max-width: 480px) {
            .container {
                margin: 0;
            }

            .settings-content {
                padding: 15px;
            }

            .settings-section {
                padding: 15px;
                margin-bottom: 15px;
            }

            .setting-item {
                flex-direction: row;
                gap: 15px;
                padding: 20px 0;
                min-height: 60px;
            }

            .setting-left {
                flex-direction: row;
                gap: 15px;
                align-items: center;
            }

            .setting-content {
                flex-direction: column;
                gap: 5px;
                justify-content: center;
            }

            .setting-icon {
                width: 40px;
                height: 40px;
                font-size: 20px;
            }

            .setting-label {
                font-size: 15px;
            }

            .setting-desc {
                font-size: 12px;
            }

            .volume-slider {
                width: 100px;
                min-width: auto;
            }



            .color-picker-trigger {
                min-width: 100px;
            }

            .color-grid {
                grid-template-columns: repeat(3, 1fr);
                gap: 12px;
            }
        }

        /* 主题颜色样式 */
        body.theme-blue {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
            background-attachment: fixed !important;
        }

        body.theme-green {
            background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%) !important;
            background-attachment: fixed !important;
        }

        body.theme-orange {
            background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
            background-attachment: fixed !important;
        }

        body.theme-purple {
            background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
            background-attachment: fixed !important;
        }

        body.theme-pink {
            background: linear-gradient(135deg, #fa709a 0%, #fee140 100%) !important;
            background-attachment: fixed !important;
        }

        body.theme-red {
            background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%) !important;
            background-attachment: fixed !important;
        }

        body.theme-yellow {
            background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%) !important;
            background-attachment: fixed !important;
        }

        body.theme-cyan {
            background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%) !important;
            background-attachment: fixed !important;
        }

        body.theme-lime {
            background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%) !important;
        }

        body.theme-indigo {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
            background-attachment: fixed !important;
        }

        body.theme-teal {
            background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
            background-attachment: fixed !important;
        }

        body.theme-rose {
            background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%) !important;
            background-attachment: fixed !important;
        }

        body.theme-amber {
            background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%) !important;
            background-attachment: fixed !important;
        }

        body.theme-emerald {
            background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%) !important;
            background-attachment: fixed !important;
        }

        body.theme-sky {
            background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
            background-attachment: fixed !important;
        }

        body.theme-violet {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
            background-attachment: fixed !important;
        }
    </style>
</head>
<body>
    <div class="container">
                            <div class="header">
                        <button class="back-btn" onclick="goBack()">←</button>
                        <h1>游戏设置</h1>
                        <button class="test-btn" onclick="testTheme()" style="position: absolute; right: 20px; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.2); border: none; color: white; padding: 8px 12px; border-radius: 6px; font-size: 12px;">测试主题</button>
                    </div>

        <div class="settings-content">
            <div class="settings-section">
                <h3 class="settings-title">
                    <span>🎵</span>
                    音频设置
                </h3>
                
                <div class="setting-item">
                    <div class="setting-left">
                        <div class="setting-icon">🎵</div>
                        <div class="setting-content">
                            <div class="setting-label">背景音乐</div>
                            <div class="setting-desc">开启/关闭游戏背景音乐</div>
                        </div>
                    </div>
                    <div class="toggle-switch">
                        <input type="checkbox" id="bgMusicToggle" checked>
                        <label for="bgMusicToggle" class="toggle-label"></label>
                    </div>
                </div>

                <div class="setting-item">
                    <div class="setting-left">
                        <div class="setting-icon">🔊</div>
                        <div class="setting-content">
                            <div class="setting-label">音效开关</div>
                            <div class="setting-desc">开启/关闭游戏音效</div>
                        </div>
                    </div>
                    <div style="display: flex; align-items: center; gap: 15px;">
                        <div class="toggle-switch">
                            <input type="checkbox" id="soundEffectToggle" checked>
                            <label for="soundEffectToggle" class="toggle-label"></label>
                        </div>
                        <div class="sound-status" id="soundStatus">🔊</div>
                    </div>
                </div>

                <div class="setting-item">
                    <div class="setting-left">
                        <div class="setting-icon">🔊</div>
                        <div class="setting-content">
                            <div class="setting-label">音效音量</div>
                            <div class="setting-desc">调整游戏音效音量大小</div>
                        </div>
                    </div>
                    <div class="volume-slider">
                        <input type="range" id="volumeSlider" min="0" max="100" value="80" class="slider">
                    </div>
                </div>

                <div class="setting-item">
                    <div class="setting-left">
                        <div class="setting-icon">📱</div>
                        <div class="setting-content">
                            <div class="setting-label">震动反馈</div>
                            <div class="setting-desc">开启/关闭设备震动反馈</div>
                        </div>
                    </div>
                    <div style="display: flex; align-items: center; gap: 15px;">
                        <div class="toggle-switch">
                            <input type="checkbox" id="vibrationToggle" checked>
                            <label for="vibrationToggle" class="toggle-label"></label>
                        </div>
                        <button class="test-vibration-btn" onclick="testVibration()" title="测试震动反馈">
                            📳
                        </button>
                    </div>
                </div>
            </div>

            <div class="settings-section">
                <h3 class="settings-title">
                    <span>🎮</span>
                    游戏设置
                </h3>
                
                <div class="setting-item">
                    <div class="setting-left">
                        <div class="setting-icon">🆕</div>
                        <div class="setting-content">
                            <div class="setting-label">我是新手</div>
                            <div class="setting-desc">开启新手模式，获得更多游戏提示</div>
                        </div>
                    </div>
                    <div class="toggle-switch">
                        <input type="checkbox" id="newbieToggle">
                        <label for="newbieToggle" class="toggle-label"></label>
                    </div>
                </div>


            </div>

            <div class="settings-section">
                <h3 class="settings-title">
                    <span>🎨</span>
                    外观设置
                </h3>
                
                <div class="setting-item">
                    <div class="setting-left">
                        <div class="setting-icon">🌙</div>
                        <div class="setting-content">
                            <div class="setting-label">深色模式</div>
                            <div class="setting-desc">切换深色/浅色主题</div>
                        </div>
                    </div>
                    <div class="toggle-switch">
                        <input type="checkbox" id="darkModeToggle">
                        <label for="darkModeToggle" class="toggle-label"></label>
                    </div>
                </div>

                <div class="setting-item">
                    <div class="setting-left">
                        <div class="setting-icon">🎨</div>
                        <div class="setting-content">
                            <div class="setting-label">主题色彩</div>
                            <div class="setting-desc">选择应用背景主题颜色</div>
                        </div>
                    </div>
                    <div class="color-picker-trigger" onclick="openColorModal()">
                        <div class="current-color" id="currentColorDisplay"></div>
                        <div class="color-arrow">▼</div>
                    </div>
                </div>
            </div>

            <!-- 隐私与安全设置 -->
            <div class="settings-section">
                <h3 class="settings-title">
                    <span>🔒</span>
                    隐私与安全
                </h3>
                
                <div class="setting-item" onclick="openPrivacyPolicy()">
                    <div class="setting-left">
                        <div class="setting-icon">🔒</div>
                        <div class="setting-content">
                            <div class="setting-label">隐私政策</div>
                            <div class="setting-desc">查看个人信息保护政策</div>
                        </div>
                    </div>
                    <div class="setting-arrow">></div>
                </div>

                <div class="setting-item" onclick="openUserAgreement()">
                    <div class="setting-left">
                        <div class="setting-icon">📋</div>
                        <div class="setting-content">
                            <div class="setting-label">用户协议</div>
                            <div class="setting-desc">查看用户服务协议条款</div>
                        </div>
                    </div>
                    <div class="setting-arrow">></div>
                </div>
            </div>

            <!-- 帮助与支持 -->
            <div class="settings-section">
                <h3 class="settings-title">
                    <span>❓</span>
                    帮助与支持
                </h3>
                
                <div class="setting-item" onclick="openHelpCenter()">
                    <div class="setting-left">
                        <div class="setting-icon">❓</div>
                        <div class="setting-content">
                            <div class="setting-label">帮助中心</div>
                            <div class="setting-desc">获取游戏帮助和常见问题解答</div>
                        </div>
                    </div>
                    <div class="setting-arrow">></div>
                </div>
            </div>

            <!-- 应用信息 -->
            <div class="settings-section">
                <h3 class="settings-title">
                    <span>ℹ️</span>
                    应用信息
                </h3>
                
                <div class="setting-item" onclick="openAboutUs()">
                    <div class="setting-left">
                        <div class="setting-icon">ℹ️</div>
                        <div class="setting-content">
                            <div class="setting-label">关于我们</div>
                            <div class="setting-desc">了解应用开发团队和版本信息</div>
                        </div>
                    </div>
                    <div class="setting-arrow">></div>
                </div>
            </div>
        </div>
    </div>

    <!-- 颜色选择模态框 -->
    <div id="colorModal" class="color-modal">
        <div class="color-modal-content">
            <div class="color-modal-header">
                <h3 class="color-modal-title">选择主题颜色</h3>
                <button class="close-btn" onclick="closeColorModal()">&times;</button>
            </div>
            <div class="color-modal-body">
                <div class="color-grid">
                    <div class="color-option-modal" onclick="changeThemeColor('blue')">
                        <div class="color-preview" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);"></div>
                        <div class="color-name">经典蓝</div>
                    </div>
                    <div class="color-option-modal" onclick="changeThemeColor('green')">
                        <div class="color-preview" style="background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);"></div>
                        <div class="color-name">清新绿</div>
                    </div>
                    <div class="color-option-modal" onclick="changeThemeColor('orange')">
                        <div class="color-preview" style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);"></div>
                        <div class="color-name">活力橙</div>
                    </div>
                    <div class="color-option-modal" onclick="changeThemeColor('purple')">
                        <div class="color-preview" style="background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);"></div>
                        <div class="color-name">梦幻紫</div>
                    </div>
                    <div class="color-option-modal" onclick="changeThemeColor('pink')">
                        <div class="color-preview" style="background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);"></div>
                        <div class="color-name">浪漫粉</div>
                    </div>
                    <div class="color-option-modal" onclick="changeThemeColor('red')">
                        <div class="color-preview" style="background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);"></div>
                        <div class="color-name">热情红</div>
                    </div>
                    <div class="color-option-modal" onclick="changeThemeColor('yellow')">
                        <div class="color-preview" style="background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);"></div>
                        <div class="color-name">温暖黄</div>
                    </div>
                    <div class="color-option-modal" onclick="changeThemeColor('cyan')">
                        <div class="color-preview" style="background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);"></div>
                        <div class="color-name">清新青</div>
                    </div>
                    <div class="color-option-modal" onclick="changeThemeColor('lime')">
                        <div class="color-preview" style="background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%);"></div>
                        <div class="color-name">柠檬绿</div>
                    </div>
                    <div class="color-option-modal" onclick="changeThemeColor('indigo')">
                        <div class="color-preview" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);"></div>
                        <div class="color-name">靛蓝</div>
                    </div>
                    <div class="color-option-modal" onclick="changeThemeColor('teal')">
                        <div class="color-preview" style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);"></div>
                        <div class="color-name">蓝绿</div>
                    </div>
                    <div class="color-option-modal" onclick="changeThemeColor('rose')">
                        <div class="color-preview" style="background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);"></div>
                        <div class="color-name">玫瑰</div>
                    </div>
                    <div class="color-option-modal" onclick="changeThemeColor('amber')">
                        <div class="color-preview" style="background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);"></div>
                        <div class="color-name">琥珀</div>
                    </div>
                    <div class="color-option-modal" onclick="changeThemeColor('emerald')">
                        <div class="color-preview" style="background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);"></div>
                        <div class="color-name">翡翠</div>
                    </div>
                    <div class="color-option-modal" onclick="changeThemeColor('sky')">
                        <div class="color-preview" style="background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);"></div>
                        <div class="color-name">天空</div>
                    </div>
                    <div class="color-option-modal" onclick="changeThemeColor('violet')">
                        <div class="color-preview" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);"></div>
                        <div class="color-name">紫罗兰</div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        // 返回上一页
        function goBack() {
            window.history.back();
        }

        // 打开颜色选择模态框
        function openColorModal() {
            document.getElementById('colorModal').style.display = 'block';
        }

        // 关闭颜色选择模态框
        function closeColorModal() {
            document.getElementById('colorModal').style.display = 'none';
        }

        // 打开隐私政策页面
        function openPrivacyPolicy() {
            window.location.href = 'privacy_policy.html';
        }

        // 打开用户协议页面
        function openUserAgreement() {
            window.location.href = 'user_agreement.html';
        }

        // 打开帮助中心弹窗
        function openHelpCenter() {
            showHelpModal();
        }

        // 显示帮助中心弹窗
        function showHelpModal() {
            // 创建弹窗HTML
            const modalHTML = `
                <div class="help-modal" id="helpModal">
                    <div class="help-modal-content">
                        <div class="help-modal-header">
                            <h3>🆘 帮助中心</h3>
                            <button class="help-close-btn" onclick="closeHelpModal()">×</button>
                        </div>
                        <div class="help-modal-body">
                            <div class="help-section">
                                <h4>📚 游戏帮助</h4>
                                <ul>
                                    <li>🎮 游戏规则说明</li>
                                    <li>❓ 常见问题解答</li>
                                    <li>📖 操作指南</li>
                                    <li>🎯 游戏技巧</li>
                                </ul>
                            </div>
                            <div class="help-section">
                                <h4>📧 联系我们</h4>
                                <div class="contact-info">
                                    <div class="contact-item">
                                        <span class="contact-icon">📧</span>
                                        <span class="contact-label">作者邮箱：</span>
                                        <span class="contact-value">dragon.tiger.game@gmail.com</span>
                                    </div>
                                    <div class="contact-item">
                                        <span class="contact-icon">💬</span>
                                        <span class="contact-label">客服QQ：</span>
                                        <span class="contact-value">123456789</span>
                                    </div>
                                    <div class="contact-item">
                                        <span class="contact-icon">📱</span>
                                        <span class="contact-label">微信客服：</span>
                                        <span class="contact-value">dragon_tiger_service</span>
                                    </div>
                                    <div class="contact-item">
                                        <span class="contact-icon">🌐</span>
                                        <span class="contact-label">官方网站：</span>
                                        <span class="contact-value">www.dragontiger.com</span>
                                    </div>
                                </div>
                            </div>
                            <div class="help-section">
                                <h4>⏰ 服务时间</h4>
                                <p>周一至周日 9:00 - 22:00</p>
                                <p>节假日期间正常服务</p>
                            </div>
                        </div>
                        <div class="help-modal-footer">
                            <button class="help-btn-primary" onclick="closeHelpModal()">确定</button>
                        </div>
                    </div>
                </div>
            `;
            
            // 添加到页面
            document.body.insertAdjacentHTML('beforeend', modalHTML);
            
            // 显示弹窗
            setTimeout(() => {
                document.getElementById('helpModal').classList.add('show');
            }, 10);
            
            // 禁止背景滚动
            document.body.style.overflow = 'hidden';
        }

        // 关闭帮助中心弹窗
        function closeHelpModal() {
            const modal = document.getElementById('helpModal');
            if (modal) {
                modal.classList.remove('show');
                setTimeout(() => {
                    modal.remove();
                    // 恢复背景滚动
                    document.body.style.overflow = '';
                }, 300);
            }
        }

        // 测试震动反馈
        function testVibration() {
            if ('vibrate' in navigator) {
                // 创建震动模式：短震动-暂停-长震动
                navigator.vibrate([100, 50, 200]);
                console.log('震动反馈测试完成');
            } else {
                console.log('当前设备不支持震动反馈');
                alert('当前设备不支持震动反馈功能');
            }
        }

        // 点击弹窗外部关闭弹窗
        function initHelpModalEvents() {
            document.addEventListener('click', function(event) {
                const modal = document.getElementById('helpModal');
                if (modal && event.target === modal) {
                    closeHelpModal();
                }
            });
        }

        // 页面加载完成后初始化事件
        document.addEventListener('DOMContentLoaded', function() {
            initHelpModalEvents();
        });

        // 打开关于我们页面
        function openAboutUs() {
            window.location.href = 'about_us.html';
        }

                // 改变主题颜色
        function changeThemeColor(theme) {
            console.log('开始切换主题:', theme);
            
            // 移除所有主题类
            const body = document.body;
            const allThemes = ['theme-blue', 'theme-green', 'theme-orange', 'theme-purple', 
                              'theme-pink', 'theme-red', 'theme-yellow', 'theme-cyan', 
                              'theme-lime', 'theme-indigo', 'theme-teal', 'theme-rose', 
                              'theme-amber', 'theme-emerald', 'theme-sky', 'theme-violet'];
            
            allThemes.forEach(themeClass => {
                body.classList.remove(themeClass);
            });
            
            console.log('已移除所有主题类');
            
            // 添加新主题类
            body.classList.add('theme-' + theme);
            console.log('已添加主题类:', 'theme-' + theme);
            console.log('当前body类名:', body.className);
            
            // 更新当前颜色显示
            updateCurrentColorDisplay(theme);
            
            // 保存到本地存储
            localStorage.setItem('selectedTheme', theme);
            
            // 设置主题更新时间戳，用于其他页面检测
            localStorage.setItem('themeUpdateTime', Date.now().toString());
            
            // 关闭模态框
            closeColorModal();
            
            // 显示主题切换成功提示
            console.log('主题已切换为:', theme);
            
            // 添加主题切换成功的视觉反馈
            const themeNames = {
                'blue': '经典蓝',
                'green': '清新绿',
                'orange': '活力橙',
                'purple': '梦幻紫',
                'pink': '浪漫粉',
                'red': '热情红',
                'yellow': '温暖黄',
                'cyan': '清新青',
                'lime': '柠檬绿',
                'indigo': '靛蓝',
                'teal': '蓝绿',
                'rose': '玫瑰',
                'amber': '琥珀',
                'emerald': '翡翠',
                'sky': '天空',
                'violet': '紫罗兰'
            };
            
            // 显示主题切换成功提示
            if (themeNames[theme]) {
                showThemeChangeSuccess(themeNames[theme]);
            }
            
            // 强制重新计算样式
            setTimeout(() => {
                console.log('强制重新计算样式');
                // 确保主题样式被正确应用
                const computedStyle = window.getComputedStyle(body);
                console.log('当前背景样式:', computedStyle.background);
                
                // 如果主题没有生效，强制应用
                if (!computedStyle.background.includes('gradient')) {
                    console.log('主题未生效，强制应用');
                    const themeGradients = {
                        'blue': 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
                        'green': 'linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%)',
                        'orange': 'linear-gradient(135deg, #f093fb 0%, #f5576c 100%)',
                        'purple': 'linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)',
                        'pink': 'linear-gradient(135deg, #fa709a 0%, #fee140 100%)',
                        'red': 'linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%)',
                        'yellow': 'linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%)',
                        'cyan': 'linear-gradient(135deg, #a8edea 0%, #fed6e3 100%)',
                        'lime': 'linear-gradient(135deg, #d299c2 0%, #fef9d7 100%)',
                        'indigo': 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
                        'teal': 'linear-gradient(135deg, #f093fb 0%, #f5576c 100%)',
                        'rose': 'linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%)',
                        'amber': 'linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%)',
                        'emerald': 'linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%)',
                        'sky': 'linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)',
                        'violet': 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)'
                    };
                    
                    if (themeGradients[theme]) {
                        body.style.background = themeGradients[theme];
                        body.style.backgroundAttachment = 'fixed';
                        console.log('已强制应用主题背景');
                    }
                }
            }, 100);
        }

    // 显示主题切换成功提示
    function showThemeChangeSuccess(themeName) {
        // 创建提示元素
        const notification = document.createElement('div');
        notification.style.cssText = `
            position: fixed;
            top: 20px;
            right: 20px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 15px 20px;
            border-radius: 10px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            z-index: 10000;
            font-size: 14px;
            font-weight: 500;
            transform: translateX(100%);
            transition: transform 0.3s ease;
        `;
        notification.textContent = `主题已切换为: ${themeName}，已同步到所有页面`;
        
        // 添加到页面
        document.body.appendChild(notification);
        
        // 显示提示
        setTimeout(() => {
            notification.style.transform = 'translateX(0)';
        }, 100);
        
        // 3秒后自动隐藏
        setTimeout(() => {
            notification.style.transform = 'translateX(100%)';
            setTimeout(() => {
                document.body.removeChild(notification);
            }, 300);
        }, 3000);
    }

        // 测试主题切换
        function testTheme() {
            console.log('测试主题切换');
            const themes = ['blue', 'green', 'orange', 'purple', 'pink'];
            const randomTheme = themes[Math.floor(Math.random() * themes.length)];
            console.log('随机选择主题:', randomTheme);
            changeThemeColor(randomTheme);
        }

        // 更新当前颜色显示
        function updateCurrentColorDisplay(theme) {
            const colorDisplay = document.getElementById('currentColorDisplay');
            const themeColors = {
                'blue': 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
                'green': 'linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%)',
                'orange': 'linear-gradient(135deg, #f093fb 0%, #f5576c 100%)',
                'purple': 'linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)',
                'pink': 'linear-gradient(135deg, #fa709a 0%, #fee140 100%)',
                'red': 'linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%)',
                'yellow': 'linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%)',
                'cyan': 'linear-gradient(135deg, #a8edea 0%, #fed6e3 100%)',
                'lime': 'linear-gradient(135deg, #d299c2 0%, #fef9d7 100%)',
                'indigo': 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
                'teal': 'linear-gradient(135deg, #f093fb 0%, #f5576c 100%)',
                'rose': 'linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%)',
                'amber': 'linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%)',
                'emerald': 'linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%)',
                'sky': 'linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)',
                'violet': 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)'
            };
            
            if (themeColors[theme]) {
                colorDisplay.style.background = themeColors[theme];
            }
        }

        // 页面加载时初始化
        document.addEventListener('DOMContentLoaded', function() {
            // 从本地存储恢复设置
            const savedTheme = localStorage.getItem('selectedTheme');
            if (savedTheme) {
                console.log('恢复保存的主题:', savedTheme);
                // 延迟应用主题，确保页面完全加载
                setTimeout(() => {
                    // 直接应用主题类，不调用changeThemeColor避免重复逻辑
                    const body = document.body;
                    body.classList.add('theme-' + savedTheme);
                    console.log('已应用主题类:', 'theme-' + savedTheme);
                    
                    // 更新当前颜色显示
                    updateCurrentColorDisplay(savedTheme);
                }, 100);
            }

            // 背景音乐开关事件
            const bgMusicToggle = document.getElementById('bgMusicToggle');
            bgMusicToggle.addEventListener('change', function() {
                if (this.checked) {
                    console.log('背景音乐已开启');
                    // 这里可以添加背景音乐开启逻辑
                } else {
                    console.log('背景音乐已关闭');
                    // 这里可以添加背景音乐关闭逻辑
                }
                localStorage.setItem('bgMusic', this.checked);
            });

            // 音效开关事件
            const soundEffectToggle = document.getElementById('soundEffectToggle');
            soundEffectToggle.addEventListener('change', function() {
                const soundStatus = document.getElementById('soundStatus');
                if (this.checked) {
                    console.log('音效已开启');
                    soundStatus.textContent = '🔊';
                    soundStatus.classList.remove('muted');
                    // 这里可以添加音效开启逻辑
                } else {
                    console.log('音效已关闭');
                    soundStatus.textContent = '🔇';
                    soundStatus.classList.add('muted');
                    // 这里可以添加音效关闭逻辑
                }
                localStorage.setItem('soundEffect', this.checked);
            });

            // 震动反馈开关事件
            const vibrationToggle = document.getElementById('vibrationToggle');
            vibrationToggle.addEventListener('change', function() {
                if (this.checked) {
                    console.log('震动反馈已开启');
                    // 这里可以添加震动反馈开启逻辑
                    // 测试震动反馈（如果设备支持）
                    if ('vibrate' in navigator) {
                        navigator.vibrate(100);
                    }
                } else {
                    console.log('震动反馈已关闭');
                    // 这里可以添加震动反馈关闭逻辑
                }
                localStorage.setItem('vibration', this.checked);
            });

            // 深色模式开关事件
            const darkModeToggle = document.getElementById('darkModeToggle');
            darkModeToggle.addEventListener('change', function() {
                if (this.checked) {
                    console.log('深色模式已开启');
                    document.body.classList.add('dark-mode');
                } else {
                    console.log('深色模式已关闭');
                    document.body.classList.remove('dark-mode');
                }
                localStorage.setItem('darkMode', this.checked);
            });

            // 音量滑块事件
            const volumeSlider = document.getElementById('volumeSlider');
            volumeSlider.addEventListener('input', function() {
                console.log('音效音量设置为:', this.value);
                localStorage.setItem('volume', this.value);
            });

            // 新手模式开关事件
            const newbieToggle = document.getElementById('newbieToggle');
            newbieToggle.addEventListener('change', function() {
                if (this.checked) {
                    console.log('新手模式已开启');
                } else {
                    console.log('新手模式已关闭');
                }
                localStorage.setItem('newbieMode', this.checked);
            });



            // 从本地存储恢复设置状态
            const savedBgMusic = localStorage.getItem('bgMusic');
            if (savedBgMusic !== null) {
                bgMusicToggle.checked = savedBgMusic === 'true';
            }

            const savedSoundEffect = localStorage.getItem('soundEffect');
            if (savedSoundEffect !== null) {
                soundEffectToggle.checked = savedSoundEffect === 'true';
                // 更新音效状态指示器
                const soundStatus = document.getElementById('soundStatus');
                if (soundStatus) {
                    if (savedSoundEffect === 'true') {
                        soundStatus.textContent = '🔊';
                        soundStatus.classList.remove('muted');
                    } else {
                        soundStatus.textContent = '🔇';
                        soundStatus.classList.add('muted');
                    }
                }
            }

            const savedVibration = localStorage.getItem('vibration');
            if (savedVibration !== null) {
                vibrationToggle.checked = savedVibration === 'true';
            }

            const savedDarkMode = localStorage.getItem('darkMode');
            if (savedDarkMode === 'true') {
                darkModeToggle.checked = true;
                document.body.classList.add('dark-mode');
            }

            const savedVolume = localStorage.getItem('volume');
            if (savedVolume !== null) {
                volumeSlider.value = savedVolume;
            }

            const savedNewbieMode = localStorage.getItem('newbieMode');
            if (savedNewbieMode === 'true') {
                newbieToggle.checked = true;
            }



            // 点击模态框外部关闭
            window.addEventListener('click', function(event) {
                const modal = document.getElementById('colorModal');
                if (event.target === modal) {
                    closeColorModal();
                }
            });
        });
    </script>
</body>
</html>
